<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE>
<html>
  <head>
    <base href="<%=basePath%>">
    <title>登录页面</title>
    
  </head>
  
  <body>
	<div>
		<div><h1>登录图书管理系统</h1></div>
		<div>
			<form action="user/login" method="post">
			<ul>
				<li><span>用户名：</span><input type="text" name="nickname"/></li>
				<li><span>密码：</span><input type="password" name="password"/></li>
				<li><input type="submit" value="登录"/></li>
			</ul>
			</form>
		</div>
	</div>
  </body>
  <script type="text/javascript" src="JS/jquery-1.7.2.min.js"></script>
  <script type="text/javascript">
  	if('${flag}'==2){
		alert("登录失败");
		location.href="login.jsp";
	}
	if('${flag}'==1){
		alert("登录成功");
		location.href="book/findAll";
	}
  </script>
 
</html>
